home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9069 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  42 lines

  1. Path: ix.netcom.com!netnews
  2. From: ave@ix.netcom.com(Alexander Berdichevsky )
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How can I include IOSTREAM.H only once?
  5. Date: 28 Feb 1996 13:13:44 GMT
  6. Organization: Netcom
  7. Message-ID: <4h1ke8$qgc@cloner2.ix.netcom.com>
  8. References: <4gre90$oei@service.polymtl.ca>
  9. NNTP-Posting-Host: ix-prn1-07.ix.netcom.com
  10. X-NETCOM-Date: Wed Feb 28  5:13:44 AM PST 1996
  11.  
  12. In <4gre90$oei@service.polymtl.ca> bluefox@info.polymtl.ca (Michael
  13. Gaudette) writes: 
  14. >
  15. >I am presently engaged in what is usually called "the learning
  16. process", 
  17. >and I've been programming simple programs with classes.  Because of
  18. this, 
  19. >I have had to #include <iostream.h> in most of my "class.cpp" files
  20. AND 
  21. >in my main program. This (added to conio.h and all the other standard 
  22. >libraries) usually result in a simple program being 20000 lines long.
  23. >Is there any way (using Borland v4.5) to make the compiler only link 
  24. >those files ONCE?
  25. >
  26. >Thanks in advance for any help I may receive
  27.  
  28. If you review iostream.h consider this:
  29.  
  30. #ifndef _H_IOSTREAM
  31. #define _H_IOSTREAM
  32. ...
  33. iostream.h lines
  34. ....
  35. #endif
  36.  
  37. You may use this technic for your own header files.
  38.  
  39. Regards
  40.  
  41. Alex
  42.